package com.seata.example.orders.controller;

import com.seata.example.orders.entity.Orders;
import com.seata.example.orders.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 *
 */
@RestController
public class TestController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/createOrder/{id}")
    public void createOrder(@PathVariable("id") Long id) {
        Orders orders = new Orders();
        orders.setOrderName("lyq测试");
        orders.setAmount(BigDecimal.valueOf(100.00));
        orders.setNumber(20L);
        orderService.createOrder(id, orders);
    }
}
